package cn.com.zte.ngbc.dao.mybatis.dynamicsql.node;

import cn.com.zte.common.util.StringUtil;
import cn.com.zte.ngbc.dao.mybatis.dynamicsql.DynamicContext;
import cn.com.zte.ngbc.frw.model.sql.dynamic.StrSqlNode;

public class StrSqlNodeHandler
  implements SqlNodeHandler
{
  private StrSqlNode str;
  
  public StrSqlNodeHandler(StrSqlNode str)
  {
    this.str = str;
  }
  
  public String process(DynamicContext context)
  {
    if (this.str == null) {
      return null;
    }
    
 String where =   context.selectEle.getName();
    if(where =="where")
    	context.selectEle.addText(" and ");
    context.selectEle.addText(" ");
    context.selectEle.addCDATA(this.str.getValue());
    
    
    
    return this.str.getValue();
  }
}
